package com.example.mykotilin

import android.app.Application
import android.util.Log
import androidx.work.Configuration
import com.example.mykotilin.room2.AppDatabase
import com.example.mykotilin.workmanager.lib.worker.RenameWorkerFactory


class MyApplication : Application(), Configuration.Provider {

    val database: AppDatabase by lazy {
        AppDatabase.getDatabase(this)
    }
    override fun onCreate() {
        super.onCreate()
    }

    //work配置
    override fun getWorkManagerConfiguration() =
        Configuration.Builder()
            .setWorkerFactory(RenameWorkerFactory())
            .setMinimumLoggingLevel(Log.VERBOSE)
            .build()


}